﻿Imports System.ComponentModel.Composition
Imports iConverter.Contracts



''' <summary>
''' 指定插件提供器类的元数据
''' </summary>
''' <remarks></remarks>
<MetadataAttribute(), AttributeUsage(AttributeTargets.Class, AllowMultiple:=False)>
Public Class PluginProviderAttribute
    Inherits ExportAttribute


    ''' <summary>
    ''' 获取唯一ID
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property ID As String

    ''' <summary>
    ''' 名字
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property Name As String


    ''' <summary>
    ''' 描述
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property Description As String



    ''' <summary>
    ''' 版本
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property Version As String

    ''' <summary>
    ''' 作者
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property Author As String

    ''' <summary>
    ''' 用于显示的图标
    ''' </summary>
    ''' <value></value>
    ''' <returns>如果没有可用图标则返回Nothing，否则返回图标的Bitmap对象</returns>
    ''' <remarks>大小在32*32内为最佳</remarks>
    Public Property Icon As String


    ''' <summary>
    ''' 提供器的类型
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property Type As Type

    ''' <summary>
    ''' 创建新的实例
    ''' </summary>
    ''' <param name="id">插件提供器的GUID字符串</param>
    ''' <param name="name">插件名字</param>
    ''' <param name="description">插件提供器描述</param>
    ''' <param name="version">版本</param>
    ''' <param name="author">作者</param>
    ''' <param name="icon">图标资源文件名</param>
    ''' <param name="type">插件提供器类型</param>
    ''' <remarks></remarks>
    Public Sub New(ByVal id As String,
                   ByVal name As String, 
                   ByVal description As String,
                   ByVal version As String,
                   ByVal author As String,
                   ByVal icon As String, ByVal type As Type)
        MyBase.New(GetType(IPluginProvider))

        Me.ID = id
        Me.Name = name

        Me.Description = description

        Me.Version = version

        Me.Author = author

        Me.Icon = icon


        Me.Type = Type



    End Sub



End Class
